import time

from crawler.connection import filter_push_redis, redis_conn, redis_shedana

url_list = [{'category': 'Clothing>>Tops-t-shirts', 'ids': 'mens|clothing|tops-t-shirts', 'sex': 'men'},
            {'category': 'Clothing>>Coats-jackets', 'ids': 'mens|clothing|coats-jackets', 'sex': 'men'},
            {'category': 'Clothing>>Sweats', 'ids': 'mens|clothing|sweats', 'sex': 'men'},
            {'category': 'Clothing>>Shirts', 'ids': 'mens|clothing|shirts', 'sex': 'men'},
            {'category': 'Clothing>>Jeans', 'ids': 'mens|clothing|jeans', 'sex': 'men'},
            {'category': 'Clothing>>Trousers-shorts', 'ids': 'mens|clothing|trousers-shorts', 'sex': 'men'},
            {'category': 'Clothing>>Knitwear', 'ids': 'mens|clothing|knitwear', 'sex': 'men'},
            {'category': 'Clothing>>Suits-tailoring', 'ids': 'mens|clothing|suits-tailoring', 'sex': 'men'},
            {'category': 'Clothing>>Underwear-socks', 'ids': 'mens|clothing|underwear-socks', 'sex': 'men'},
            {'category': 'Clothing>>Nightwear-loungewear', 'ids': 'mens|clothing|nightwear-loungewear', 'sex': 'men'},
            {'category': 'Clothing>>Swimwear', 'ids': 'mens|clothing|swimwear', 'sex': 'men'},
            {'category': 'Clothing>>Sportswear', 'ids': 'mens|clothing|sportswear', 'sex': 'men'},
            {'category': 'Clothing>>Blazers', 'ids': 'mens|clothing|blazers', 'sex': 'men'},
            {'category': 'Clothing>>Ski-wear', 'ids': 'mens|clothing|ski-wear', 'sex': 'men'},
            {'category': 'Shoes>>Slippers', 'ids': 'shoes|mens|shoes|slippers', 'sex': 'men'},
            {'category': 'Shoes>>Loafers', 'ids': 'shoes|mens|loafers', 'sex': 'men'},
            {'category': 'Shoes>>Sliders-flip-flops', 'ids': 'shoes|mens|sandals|sliders-flip-flops', 'sex': 'men'},
            {'category': 'Shoes>>Sandals', 'ids': 'shoes|mens|sandals', 'sex': 'men'},
            {'category': 'Shoes>>Trainers', 'ids': 'shoes|mens|trainers', 'sex': 'men'},
            {'category': 'Shoes>>Shoes', 'ids': 'shoes|mens|shoes', 'sex': 'men'},
            {'category': 'Shoes>>Shoes', 'ids': 'wedding-shop|groom|shoes', 'sex': 'men'},
            {'category': 'Shoes>>Boots', 'ids': 'shoes|mens|boots', 'sex': 'men'},
            {'category': 'Shoes>>Girls', 'ids': 'shoes|kids|girls', 'sex': 'kids'},
            {'category': 'Shoes>>Boys', 'ids': 'shoes|kids|boys', 'sex': 'kids'},
            {'category': 'Shoes>>Baby', 'ids': 'shoes|kids|baby', 'sex': 'kids'},
            {'category': 'Bags>>Backpacks', 'ids': 'bags|mens|backpacks', 'sex': 'men'},
            {'category': 'Bags>>Tote-bags', 'ids': 'bags|mens|tote-bags', 'sex': 'men'},
            {'category': 'Bags>>Wash-bags', 'ids': 'bags|mens|wash-bags', 'sex': 'men'},
            {'category': 'Bags>>Bags', 'ids': 'kids|baby|changing-bags-mats|bags', 'sex': 'baby'},
            {'category': 'Bags>>Bags', 'ids': 'kids|boys|accessories|bags', 'sex': 'boys'},
            {'category': 'Bags>>Bags', 'ids': 'kids|girls|accessories|bags', 'sex': 'girls'},
            {'category': 'Bags>>Messenger-bags', 'ids': 'bags|mens|messenger-bags', 'sex': 'men'},
            {'category': 'Bags>>Briefcases', 'ids': 'bags|mens|briefcases', 'sex': 'men'},
            {'category': 'Bags>>Belt-bags', 'ids': 'bags|mens|belt-bags', 'sex': 'men'},
            {'category': 'Bags>>Travel-bags', 'ids': 'bags|mens|travel-bags', 'sex': 'men'},
            {'category': 'Accessories>>Jewellery', 'ids': 'mens|accessories|jewellery', 'sex': 'men'},
            {'category': 'Accessories>>Belts', 'ids': 'mens|accessories|belts', 'sex': 'men'},
            {'category': 'Accessories>>Sunglasses', 'ids': 'mens|accessories|sunglasses', 'sex': 'men'},
            {'category': 'Accessories>>Cardholders', 'ids': 'mens|accessories|wallets|cardholders', 'sex': 'men'},
            {'category': 'Accessories>>Wallets', 'ids': 'mens|accessories|wallets', 'sex': 'men'},
            {'category': 'Accessories>>Hats', 'ids': 'mens|accessories|hats', 'sex': 'men'},
            {'category': 'Accessories>>Watches', 'ids': 'mens|accessories|watches', 'sex': 'men'},
            {'category': 'Accessories>>Ties', 'ids': 'mens|accessories|ties', 'sex': 'men'},
            {'category': 'Accessories>>Glasses', 'ids': 'mens|accessories|glasses', 'sex': 'men'},
            {'category': 'Accessories>>Scarves', 'ids': 'mens|accessories|scarves', 'sex': 'men'},
            {'category': 'Accessories>>Lifestyle-accessories', 'ids': 'mens|accessories|lifestyle-accessories',
             'sex': 'men'}, {'category': 'Clothing>>Dresses', 'ids': 'womens|clothing|dresses', 'sex': 'women'},
            {'category': 'Clothing>>Tops', 'ids': 'womens|clothing|tops', 'sex': 'women'},
            {'category': 'Clothing>>Coats-jackets', 'ids': 'womens|clothing|coats-jackets', 'sex': 'women'},
            {'category': 'Clothing>>Knitwear', 'ids': 'womens|clothing|knitwear', 'sex': 'women'},
            {'category': 'Clothing>>Nightwear-lingerie', 'ids': 'womens|clothing|nightwear-lingerie', 'sex': 'women'},
            {'category': 'Clothing>>Sportswear', 'ids': 'womens|clothing|sportswear', 'sex': 'women'},
            {'category': 'Clothing>>Ski-wear', 'ids': 'womens|clothing|sportswear|ski-wear', 'sex': 'women'},
            {'category': 'Clothing>>Trousers', 'ids': 'womens|clothing|trousers', 'sex': 'women'},
            {'category': 'Clothing>>Jeans', 'ids': 'womens|clothing|jeans', 'sex': 'women'},
            {'category': 'Clothing>>Skirts', 'ids': 'womens|clothing|skirts', 'sex': 'women'},
            {'category': 'Clothing>>Jumpsuits-playsuits', 'ids': 'womens|clothing|jumpsuits-playsuits', 'sex': 'women'},
            {'category': 'Clothing>>Denim', 'ids': 'womens|clothing|denim', 'sex': 'women'},
            {'category': 'Clothing>>Swimwear-beachwear', 'ids': 'womens|clothing|swimwear-beachwear', 'sex': 'women'},
            {'category': 'Clothing>>Shirts-blouses', 'ids': 'womens|clothing|tops|shirts-blouses', 'sex': 'women'},
            {'category': 'Clothing>>T-shirts-vests', 'ids': 'womens|clothing|tops|t-shirts-vests', 'sex': 'women'},
            {'category': 'Clothing>>Hoodies-sweatshirts', 'ids': 'womens|clothing|tops|hoodies-sweatshirts',
             'sex': 'women'},
            {'category': 'Clothing>>Shorts', 'ids': 'womens|clothing|trousers|shorts', 'sex': 'women'},
            {'category': 'Clothing>>Socks', 'ids': 'womens|clothing|nightwear-lingerie|lingerie|hosiery|socks',
             'sex': 'women'}, {'category': 'Shoes>>Sandals', 'ids': 'shoes|womens|sandals', 'sex': 'women'},
            {'category': 'Shoes>>Heeled-sandals', 'ids': 'shoes|womens|sandals|heeled-sandals', 'sex': 'women'},
            {'category': 'Shoes>>Flat-sandals', 'ids': 'shoes|womens|sandals|flat-sandals', 'sex': 'women'},
            {'category': 'Shoes>>Wedge-sandals', 'ids': 'shoes|womens|sandals|wedge-sandals', 'sex': 'women'},
            {'category': 'Shoes>>Trainers', 'ids': 'shoes|womens|trainers', 'sex': 'women'},
            {'category': 'Shoes>>Heels', 'ids': 'shoes|womens|heels', 'sex': 'women'},
            {'category': 'Shoes>>Evening-shoes', 'ids': 'shoes|womens|evening-shoes', 'sex': 'women'},
            {'category': 'Shoes>>Shoes', 'ids': 'wedding-shop|bridalwear|shoes', 'sex': 'women'},
            {'category': 'Shoes>>Flats', 'ids': 'shoes|womens|flats', 'sex': 'women'},
            {'category': 'Shoes>>Mules', 'ids': 'shoes|womens|mules', 'sex': 'women'},
            {'category': 'Shoes>>Loafers', 'ids': 'shoes|womens|flats|loafers', 'sex': 'women'},
            {'category': 'Shoes>>Boots', 'ids': 'shoes|womens|boots', 'sex': 'women'},
            {'category': 'Shoes>>Slippers', 'ids': 'shoes|womens|flats|slippers', 'sex': 'women'},
            {'category': 'Bags>>Bags', 'ids': 'bags', 'sex': 'women'},
            {'category': 'Bags>>Tote-bags', 'ids': 'bags|womens|tote-bags', 'sex': 'women'},
            {'category': 'Bags>>Bags', 'ids': 'wedding-shop|bridalwear|bags', 'sex': 'women'},
            {'category': 'Bags>>Mini-bags', 'ids': 'bags|womens|mini-bags', 'sex': 'women'},
            {'category': 'Bags>>Top-handle-bags', 'ids': 'bags|womens|top-handle-bags', 'sex': 'women'},
            {'category': 'Bags>>Oversized-bags', 'ids': 'bags|womens|oversized-bags', 'sex': 'women'},
            {'category': 'Bags>>Belt-bags', 'ids': 'bags|womens|belt-bags', 'sex': 'women'},
            {'category': 'Bags>>Beach-bags', 'ids': 'bags|womens|beach-bags', 'sex': 'women'},
            {'category': 'Bags>>Wallets', 'ids': 'womens|accessories|purses-and-pouches|wallets', 'sex': 'women'},
            {'category': 'Bags>>Wash-bags', 'ids': 'bags|womens|wash-bags', 'sex': 'women'},
            {'category': 'Bags>>Bag-accessories', 'ids': 'bags|womens|bag-accessories', 'sex': 'women'},
            {'category': 'Bags>>Cross-body-bags', 'ids': 'bags|womens|cross-body-bags', 'sex': 'women'},
            {'category': 'Bags>>Shoulder-bags', 'ids': 'bags|womens|shoulder-bags', 'sex': 'women'},
            {'category': 'Bags>>Tote-bags', 'ids': 'bags|w∂çomens|tote-bags', 'sex': 'men'},
            {'category': 'Bags>>Backpacks', 'ids': 'bags|womens|backpacks', 'sex': 'women'},
            {'category': 'Bags>>Clutch-bags', 'ids': 'bags|womens|clutch-bags', 'sex': 'women'},
            {'category': 'Accessories>>Accessories', 'ids': 'womens|accessories', 'sex': 'women'},
            {'category': 'Accessories>>Sunglasses', 'ids': 'womens|accessories|sunglasses', 'sex': 'women'},
            {'category': 'Accessories>>Eyewear', 'ids': 'womens|accessories|eyewear', 'sex': 'women'},
            {'category': 'Accessories>>Purses-and-pouches', 'ids': 'womens|accessories|purses-and-pouches',
             'sex': 'women'},
            {'category': 'Accessories>>Cardholders', 'ids': 'womens|accessories|purses-and-pouches|cardholders',
             'sex': 'women'}, {'category': 'Accessories>>Belts', 'ids': 'womens|accessories|belts', 'sex': 'women'},
            {'category': 'Accessories>>Hats', 'ids': 'womens|accessories|hats', 'sex': 'women'},
            {'category': 'Accessories>>Scarves', 'ids': 'womens|accessories|scarves', 'sex': 'women'},
            {'category': 'Accessories>>Fine-jewellery', 'ids': 'jewellery-watches|fine-jewellery', 'sex': 'women'},
            {'category': 'Accessories>>Watches', 'ids': 'womens|accessories|watches', 'sex': 'women'},
            {'category': 'Accessories>>Hair-accessories', 'ids': 'womens|accessories|hair-accessories', 'sex': 'women'}]

for index, info in enumerate(url_list):
    task = {
        "jobId": index,
        'info':info,
        'domain': 'selfridges'.upper(),
        'filename': 'main',
        'types': 'electronic_business',
        "scheduleTime": int(time.time() * 1000),
        "triggerChannel": 'SONIC_SPIDER',
    }
    result = filter_push_redis(redis_conn, f'{task["types"]}_{task["filename"]}_{task["domain"]}', task)
    # result = filter_push_redis(redis_shedana, f'{task["types"]}_{task["filename"]}_{task["domain"]}', task)
    print(result)
    # input()
